<%@ page pageEncoding="UTF-8" %>
<%@ include file="../common/IncludeTop.jsp"%>

<div id="BackLink">
    <a href="main">返回主菜单</a>
</div>

<div id="Catalog">
<table>
    <tr>
        <th align="center" colspan="2">订单#${sessionScope.order.orderId} ${sessionScope.time}</th>
    </tr>
    <tr>
        <th colspan="2">订单详情</th>
    </tr>
    <tr>
        <td>银行卡:</td>
        <td>${sessionScope.order.cardType}</td>
    </tr>
    <tr>
        <td>卡号:</td>
        <td>${sessionScope.order.creditCard}</td>
    </tr>
    <tr>
        <td>配送日期：</td>
        <td>${sessionScope.order.expiryDate}</td>
    </tr>
    <tr>
        <th colspan="2">订单地址</th>
    </tr>
    <tr>
        <td>名：</td>
        <td>${sessionScope.loginAccount.firstName}</td>
    </tr>
    <tr>
        <td>姓：</td>
        <td>${sessionScope.loginAccount.lastName}</td>
    </tr>
    <tr>
        <td>地址一：</td>
        <td>${sessionScope.loginAccount.address1}</td>
    </tr>
    <tr>
        <td>地址二:</td>
        <td>${sessionScope.loginAccount.address2}</td>
    </tr>
    <tr>
        <td>城市：</td>
        <td>${sessionScope.loginAccount.city}</td>
    </tr>
    <tr>
        <td>州：</td>
        <td>${sessionScope.loginAccount.state}</td>
    </tr>
    <tr>
        <td>邮政编码：</td>
        <td>${sessionScope.loginAccount.zip}</td>
    </tr>
    <tr>
        <td>国家：</td>
        <td>${sessionScope.loginAccount.country}</td>
    </tr>
    <tr>
        <th colspan="2">收货地址：</th>
    </tr>
    <tr>
        <td>名：</td>
        <td>${sessionScope.order.shipToFirstName}</td>
    </tr>
    <tr>
        <td>姓名：</td>
        <td>${sessionScope.order.shipToLastName}</td>
    </tr>
    <tr>
        <td>地址一：</td>
        <td>${sessionScope.order.shipAddress1}</td>
    </tr>
    <tr>
        <td>地址二：</td>
        <td>${sessionScope.order.shipAddress2}</td>
    </tr>
    <tr>
        <td>城市：</td>
        <td>${sessionScope.order.shipCity}</td>
    </tr>
    <tr>
        <td>州：</td>
        <td>${sessionScope.order.shipState}</td>
    </tr>
    <tr>
        <td>邮政编码：</td>
        <td>${sessionScope.order.shipZip}</td>
    </tr>
    <tr>
        <td>国家：</td>
        <td>${sessionScope.order.shipCountry}</td>
    </tr>
    <tr>
        <td>物流公司：</td>
        <td>YUNDA</td>
    </tr>
    <tr>
        <td>状态：</td>
        <td>Delivering</td>
    </tr>
    <tr>
        <td colspan="2">
            <table>
                <tr>
                    <th>宠物ID</th>
                    <th>描述</th>
                    <th>数量</th>
                    <th>价格</th>
                    <th>总计</th>
                </tr>

                <c:forEach var="cartItem" items="${sessionScope.cart.cartItems}">
                    <tr>
                        <td>
                            <a href="viewItem?itemId=${cartItem.item.itemId}">${cartItem.item.itemId}</a>
                        </td>
                        <td>
                                ${cartItem.item.attribute1} ${cartItem.item.attribute2}
                                ${cartItem.item.attribute3} ${cartItem.item.attribute4}
                                ${cartItem.item.attribute5} ${cartItem.item.product.name}
                        </td>
                        <td>
                            ${cartItem.quantity}
                        </td>
                        <td>
                            <fmt:formatNumber value="${cartItem.item.listPrice}" pattern="¥#,##0.00" />
                        </td>
                        <td>
                            <fmt:formatNumber value="${cartItem.total}" pattern="¥#,##0.00" />
                        </td>
                    </tr>
                </c:forEach>

                <tr>
                    <th>总计</th>
                    <td><fmt:formatNumber value="${sessionScope.order.totalPrice}" pattern="¥#,##0.00" /></td>
                </tr>
            </table>
        </td>
    </tr>

</table>

</div>

</div>

<%@ include file="../common/IncludeBottom.jsp"%>